package it.zqdszb.ui.adapter;

import android.app.Activity;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import it.zqdszb.R;
import it.zqdszb.entity.ChannelListBean;
import it.zqdszb.library.utils.utils.GlideUtil.GlideImgManager;

/**
 * Created by GH on 2018-05-15.
 */

public class ChannelListAdapter extends BaseQuickAdapter<Object,BaseViewHolder> {

	private Activity activity;

	public ChannelListAdapter(int layoutResId, @Nullable List<Object> data, Activity activity) {
		super(layoutResId, data);
		this.activity=activity;
	}
	@Override
	protected void convert(BaseViewHolder helper, Object item) {
		if(item instanceof ChannelListBean){
			ChannelListBean bean= (ChannelListBean) item;
			GlideImgManager.loadRoundCornerImage(activity, bean.getRimage().get(0), helper.<ImageView>getView(R.id.iv));
			helper.setText(R.id.title,bean.getName());
		}

	}
}
